money = 5000000
name = input('请输入您的姓名：')


def search_account():
    """
    查询账户
    :return:
    """
    print('-' * 15 + '查询余额' + '-' * 15)
    print(f'{name}，您好，您的余额剩余：{money}元')


def put_money():
    """
    存钱
    :param a 存的钱
    """
    a = eval(input('请输入您要存款的金额：'))
    global money
    money = money + a
    print('-'*15 + '存款' + '-'*15)
    print(f'{name}，您好，您存款{a}元成功')
    print(f'{name}，您好，您的余额：{money}元')


def take_money():
    """
    取款
    :return:
    """
    global money
    b = eval(input('请输入您要取款的金额：'))
    money = money - b
    print('-' * 15 + '取款' + '-' * 15)
    print(f'{name}，您好，您存款{b}元成功')
    print(f'{name}，您好，您的余额：{money}元')


def main():
    """
    主菜单：选择对应操作
    :return: 数字
    """
    print('-' * 15 + '主菜单' + '-' * 15)
    print(f'{name}，您好，欢迎来到广州新华银行ATM。请选择操作：')
    print('查询余额 [输入1]')
    print('存款 [输入2]')
    print('取款 [输入3]')
    print('退出 [输入4]')
    temp = eval(input('请输入您的选择：'))
    return temp


while True:
    instruct = main()
    if instruct == 1:
        search_account()
    elif instruct == 2:
        put_money()
    elif instruct == 3:
        take_money()
    else:
        break

